﻿using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using TSVNAddin.Core;
using Rhino.Mocks;

namespace TSVNAddin.Core.Test
{
	[TestFixture]
	public class CommandProviderFixture
	{
		[Test]
		public void GetCommand()
		{
			ICommand command = MockRepository.GenerateMock<ICommand>();

			CommandDictionary commands = new CommandDictionary();
			commands.Add(CommandType.RootShowChanges, command);

			CommandProvider commandProvider = new CommandProvider(commands);
			ICommand retCommand = commandProvider.GetCommand("TSVNAddin.Connect.RootShowChanges");

			Assert.AreEqual(command, retCommand);
		}

		[Test]
		public void GetCommand_WithShortString()
		{
			ICommand command = MockRepository.GenerateMock<ICommand>();

			CommandDictionary commands = new CommandDictionary();
			commands.Add(CommandType.RootShowChanges, command);

			CommandProvider commandProvider = new CommandProvider(commands);
			ICommand retCommand = commandProvider.GetCommand("RootShowChanges");

			Assert.AreEqual(command, retCommand);
		}
	}
}
